<script>
$(function() {
	$( "#tabs" ).tabs({
	    select: function(event, ui) {
	        var url = $.data(ui.tab, 'load.tabs');
	        if( url ) {
	            location.href = url;
	            return false;
	        }
	        return true;
	    },
	selected: 0
	});
});
</script>
<div id="tabs">
	<ul>
            <li><a href='#pt'>Thu - Chi</a> </li>
            <li><?php echo $this->Html->link(__('Thêm thu - chi', true), array('controller'=>'chiphikhoas','action' => 'add',$khoa_id)); ?></li>
           <li><?php echo $this->Html->link(__('Thống kê', true), array('controller'=>'chiphikhoas','action' => 'bieudo',$khoa_id)); ?></li>
    </ul>
<div class="Chiphikhoas index">
<?php
if(!empty($rows)&&!empty($cols)&&!empty($data))
	echo $ctable->thu_chi($rows, $cols, $data);?>
<br>
<h2 style="text-align: center;"><?php __('Thu - Chi của Đoàn khoa trong năm học '.$this->Session->read('namhocht_ten'));?></h2>
	<table cellpadding="0" cellspacing="0" id="tables">
	<tr>
			<th><?php echo 'STT';?></th>
			<th><?php echo 'Loại Phí';?></th>
			<!--<th><?php //echo $this->Paginator->sort('Chi Đoàn');?></th>-->
			<th><?php echo 'Ngày Thu(Chi)';?></th>
			<th><?php echo 'Số Tiền (VNĐ)';?></th>
			<th><?php echo 'Lý Do';?></th>
			<th><?php echo 'Người Nhận';?></th>
			<th><?php echo 'Ghi Chú';?></th>
			<th class="actions"><?php __('Lựa chọn');?></th>
	</tr>
	<?php
	$i = 0;
	foreach ($chiphikhoas as $chiphikhoa):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $i; ?>&nbsp;</td>
		<td>
			<?php echo $chiphikhoa['Loaichiphi']['tenloaichiphi']; ?>
		</td>
		<!--<td>
			<?php //echo $this->Html->link($Chiphikhoa['Chidoansv']['id'], array('controller' => 'chidoansvs', 'action' => 'view', $Chiphikhoa['Chidoansv']['id'])); ?>
		</td>
		-->
		<td><?php echo date('d-m-Y',strtotime($chiphikhoa['Chiphikhoa']['ngaynhan'])); ?>&nbsp;</td>
		<td><?php echo number_format($chiphikhoa['Chiphikhoa']['sotien'],0,',','.'); ?>&nbsp;</td>
		<td><?php echo $chiphikhoa['Chiphikhoa']['lydo']; ?>&nbsp;</td>
		<td><?php echo $chiphikhoa['Chiphikhoa']['nguoinhantien']; ?>&nbsp;</td>
		<td><?php echo $chiphikhoa['Chiphikhoa']['ghichu']; ?>&nbsp;</td>
		<td class="actions">
			<?php echo $this->Html->link(__('Sửa', true), array('action' => 'edit',$chiphikhoa['Chiphikhoa']['id'],$chiphikhoa['Chiphikhoa']['khoa_id'],)); ?>
			<?php echo $this->Html->link(__('Xóa', true), array('action' => 'delete',$khoa_id,$namhoc,$chiphikhoa['Chiphikhoa']['id']), null, sprintf(__('Bạn muốn xóa %s?', true), $chiphikhoa['Loaichiphi']['tenloaichiphi'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Trang %page%/%pages%, hiện có %count% mẫu tin', true)
	));
	?>	</p>

	<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('Trước', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('Sau', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
</div>
